/*
 * Copyright (C) 2012  Romain DUBOIS
 * 
 * This file is part of NeMoS - Network and Modular Software
 * 
 * NeMoS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * NeMoS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with NeMoS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nemos.launch.test;

import static org.ops4j.pax.exam.CoreOptions.composite;
import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
import static org.ops4j.pax.exam.CoreOptions.frameworkStartLevel;
import nemos.util.test.TestHelper;

import org.ops4j.pax.exam.Option;

/**
 * LaunchConfig : The launch tests config class.
 * 
 * @author Romain DUBOIS
 */
public final class LaunchConfig {

    /** The target start level */
    static final int TARGET_LEVEL = 5;
    /** The file install poll time */
    static final int FILE_INSTALL_POLL = 10;

    /** The felix file install poll property name */
    private static final String FELIX_FILEINSTALL_POLL = "felix.fileinstall.poll"; //$NON-NLS-1$
    /** The NeMoS launch level property */
    private static final String NEMOS_LAUNCH_LEVEL = "nemos.launch.level"; //$NON-NLS-1$

    /**
     * Get the launcher-specific test options.
     * 
     * @return The launcher configuration
     */
    public static Option launcherConfig() {

        return composite(frameworkStartLevel(1),
                frameworkProperty(FELIX_FILEINSTALL_POLL).value(String.valueOf(FILE_INSTALL_POLL)),
                frameworkProperty(NEMOS_LAUNCH_LEVEL).value(String.valueOf(TARGET_LEVEL)),
                TestHelper.mainConfig(1, 1));
    }

    /**
     * Private constructor (util class).
     */
    private LaunchConfig() {
        super();
    }
}
